﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            var uid = textBox1.Text;
            var pwd = textBox2.Text;
            var sql = string.Format("select * from Users where Username='{0}'and Password='{1}'", uid, pwd);
            var zh = Dbhelp.GetData(sql);
            if (zh.Rows.Count == 1)
            {
                MessageBox.Show("登录成功");
                MainForm mainwebsite = new MainForm();
                mainwebsite.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("登陆失败，请重试");
            }
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            zhuce zhuce = new zhuce();
            this.Hide();
            zhuce.Show();
        }
    }
}
